#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=2e5+1000;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL a[maxn],pre[maxn],suf[maxn];
LL ksm(LL a,LL k){
   LL res=1;
   while(k>0){
     if(k&1) res=res*a;
     a=a*a;
     k>>=1;
   }
   return res;
}
int main(void)
{
  LL n,k,x;n=read();k=read();x=read();
  for(LL i=1;i<=n;i++) a[i]=read();
  for(LL i=1;i<=n;i++) pre[i]=pre[i-1]|a[i];
  for(LL i=n;i>=1;i--) suf[i]=suf[i+1]|a[i];
  LL ans=0;
  for(LL i=1;i<=n;i++){
      LL temp=ksm(x,k);
      LL res=temp*a[i];
      ans=max(ans,pre[i-1]|res|suf[i+1]);
  }
  cout<<ans<<"\n";
return 0;
}
